//
//  TBMacros.h
//  SafeFoodManagerDemo
//
//  Created by bob on 2017/9/15.
//  Copyright © 2017年 bob. All rights reserved.
//一些常用的宏

#ifndef TBMacros_h
#define TBMacros_h

//DEBUG  模式下打印日志,当前行
#ifdef DEBUG
#   define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt),__PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#   define DLog(...)
#endif

#define TBWeak  __weak __typeof(self) weakSelf = self
//获取系统对象
#define kApplication        [UIApplication sharedApplication]
#define kAppWindow          [UIApplication sharedApplication].delegate.window
#define kAppDelegate        [AppDelegate shareAppDelegate]
#define kRootViewController [UIApplication sharedApplication].delegate.window.rootViewController
#define USER_DEFAULT [NSUserDefaults standardUserDefaults]

#define SetLoadIP(value)      [USER_DEFAULT setObject:value forKey:@"LoadIP"]

#define GetLoadIP             [USER_DEFAULT objectForKey:@"LoadIP"]

#define kDevice_Is_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)

#define IPhoneXTableHeight 34
#endif /* TBMacros_h */
